<template>
    <div 
    class="tool-nologin" 
    :style="{'backgroundImage': `url(${bcgImg})` , 'height': `${imgHeight}`}"
    >
        <div class="tool-nologin-main" :class="type">
            <div>查看{{name}}，需要您进行先登录</div>
            
            <el-button size="medium"  @click="goLogin">登录</el-button>
           
            <slot></slot>
        </div>

    </div>
</template>

<script>
import { mapGetters} from 'vuex';


export default {
    props: {
        name: {
            type: String,
            default: '',
        },
        imgUrl: {
            type: String,
            default: '',
        },
        type:{
            type: String,
            default: 'figure',
            // figure/info
        },
        imgHeight:{
            type: String,
            default: '200px',
        },
    },
    data() {
        return {
            dialogVisible: false,
        };
    },
    computed: {
        ...mapGetters({
            statisticData: 'userinfo/getStatisticData',
        }),
       
        
        bcgImg() {
            return this.imgUrl;
        },
    },
    methods: {
        goLogin() {
            this.$store.dispatch('global-dialog/showLogin')
        },
    },
    created() {},
    mounted() {},
};
</script>

<style lang="scss" scoped>
@import '@css/var.scss';

.tool-nologin {
    // height: 422px;
    background-size: 100% auto;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    // align-items: center;

    .tool-nologin-main {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 15px 0;
        width: 703px;
        height: 223px;
        background-color: #fff;
        font-weight: 600;
        font-size: 14px;

        .el-button {
            width: 116px;
            height: 32px;
            display: flex;
            justify-content: center;
            align-items: center;
            background-color: #ff9f3b;
            color: #fff;
        }
    }

    .figure {
        height: 150px;
        margin-top: 200px;
        box-shadow: 0px 0px 1.1px rgba(0, 0, 0, 0.017), 0px 0px 3.1px rgba(0, 0, 0, 0.025), 0px 0px 7.5px rgba(0, 0, 0, 0.033), 0px 0px 25px rgba(0, 0, 0, 0.05);

        .el-button {
            margin-top: 40px;
        }
    }

    .info {
        height: 150px;
        margin-top: 30px;
        box-shadow: 0px 0px 1.1px rgba(0, 0, 0, 0.017), 0px 0px 3.1px rgba(0, 0, 0, 0.025), 0px 0px 7.5px rgba(0, 0, 0, 0.033), 0px 0px 25px rgba(0, 0, 0, 0.05);

        .el-button {
            margin-top: 20px;
        }
    }

    .tool-nologin-bottom {
        display: flex;
        justify-content: center;
        align-items: flex-end;
    }
}
</style>
